﻿
@{
    ViewBag.Title = "TinyMCE 集成演示";
}

@section Header{
    <link href="~/Content/bootstrap.min.css" rel="stylesheet" />
    <link href="~/Content/bootstrap-theme.min.css" rel="stylesheet" />
}

<ul class="nav nav-tabs" role="tablist" style="margin-bottom:25px;">
    <li role="presentation"><a href="@Url.Action("Index")">SigFinder 演示：</a></li>
    <li role="presentation"  class="active"><a href="@Url.Action("DemoTinyMCE")">TinyMCE 集成演示</a></li>
    <li role="presentation"><a href="@Url.Action("DemoCkeditor")">Ckeditor 集成演示</a></li>
</ul>
 <div class="demo">
     <textarea name="content"></textarea>
 </div>

@section footer{
<script src="~/Scripts/jquery-3.1.1.min.js"></script>
<script src="~/Scripts/bootstrap.min.js"></script>
    <script src="~/plugins/tinymce/tinymce.min.js"></script>
    <script>
    tinymce.init({
            selector: 'textarea',  // change this value according to your HTML
            height: 500,
         
            theme: 'modern',
            convert_urls: false,
            plugins: [
              'advlist autolink lists link image charmap print preview hr anchor pagebreak',
              'searchreplace wordcount visualblocks visualchars code fullscreen',
              'insertdatetime media nonbreaking save table contextmenu directionality',
              'emoticons template paste textcolor colorpicker textpattern imagetools codesample toc'
            ],
            toolbar1: 'undo redo | insert | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image print preview media | forecolor backcolor emoticons | codesample',
            image_advtab: true,
            templates: [
              { title: 'Test template 1', content: 'Test 1' },
              { title: 'Test template 2', content: 'Test 2' }
            ],
            //picture manager
            file_browser_callback: callSigFinder,
            templates: [
        { title: 'Some title 1', description: 'Some desc 1', content: 'My content' },
        { title: 'Some title 2', description: 'Some desc 2', url: 'development.html' }
            ]

        });
        function callSigFinder(field_name, url, type, win) {
            var roxyFileman = '@Url.Action("FinderForTinyMCE", "File", new { area = "Admin" })';
            tinyMCE.activeEditor.windowManager.open({
            file: roxyFileman,
            title: 'SigFinder',
            width: 850,
            height: 655,
            resizable: "yes",
            plugins: "media",
            inline: "yes",
            close_previous: "no"
            }, { window: win, input: field_name });
            return false;

            }
</script>
    }

